package com.way.v2;

/**
 * @author 魏彪
 */
public abstract class Payment {

    abstract String getName();

    public String pay(String uid, double amount) {
        // 余额是否足够
        if (queryBalance(uid) < amount) {
            return "支付失败,余额不足";
        }
        return "支付成功, 支付金额: " + amount;
    }

    protected abstract double queryBalance(String uid);
}
